Magnetic sensor, and method of compensating temperature-dependent characteristic of magnetic sensor

ABSTRACT

A magnetic sensor  10  includes GMR elements  11 - 18,  and heating coils  21 - 24  serving as heat generating elements. The elements  11 - 14  and  15 - 18  are bridge-interconnected to constitute X-axis and Y-axis sensors, respectively. The heating coils  21, 22, 23,  and  24  are disposed adjacent to the elements  11  and  12,  the elements  13  and  14,  the elements  15  and  16,  and the elements  17  and  18,  respectively. The heating coils  21 - 24,  when electrically energized, heat mainly the adjacent elements. Therefore, the elements can be heated and cooled in a short period of time in which constant geomagnetism can be ensured. Data for compensation of temperature-dependent characteristic (ratio of change in sensor output value to variation in element temperature) is obtained on the basis of the temperatures of the elements before and after the heating, and the magnetic sensor outputs before and after the heating. Subsequently, the temperature characteristics of the elements are compensated on the basis of the data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a division of U.S. application Ser. No. 10/720,253,filed Nov. 25, 2003, the entirety of which is incorporated by reference.

TECHNICAL FIELD

The present invention relates to a magnetic sensor utilizing amagnetoresistive element.

BACKGROUND ART

There has hitherto been known a magnetic sensor which utilizes amagnetoresistive element, such as a ferromagnetic magnetoresistiveelement (MR element), a giant magnetoresistive element (GMR element) ora tunnel magnetoresistive element (TMR element), as a magnetic fielddetecting element, and which, on the basis of a resistance value of themagnetoresistive element, generates an output value according to anexternal magnetic field acting on the magnetoresistive element.

The resistance value of a magnetoresistive element is dependent ontemperature. Therefore, even when under a magnetic field of fixedmagnitude, output value of the magnetic sensor varies with thetemperature of the magnetoresistive element. Consequently, compensatingthis temperature dependence is an essential requirement for detecting(the magnitude of) a magnetic field with high precision.

A magnetic sensor apparatus described in Japanese Patent ApplicationLaid-open (kokai) No. H06-77558 attains such compensation by means of atemperature sensor disposed adjacent to a magnetoresistive element. Arelation between voltage, serving as an output value of the magneticsensor, and temperature (temperature-dependent characteristic) ismeasured in advance and stored in a memory. Then, on the basis of anactual temperature detected by the temperature sensor and the relationstored in the memory, a reference voltage is determined, and adifference between an actual voltage output by the magnetic sensor andthe determined reference voltage is amplified and output to therebycompensate the temperature-dependent characteristic of the magneticsensor.

Meanwhile, the output value of a high sensitive magnetic sensor variesunder an influence of geomagnetism, and geomagnetism varies with time.Consequently, the temperature-dependent characteristic stored in thememory of the above-mentioned magnetic sensor apparatus must to bemeasured within a predetermined short period of time in whichgeomagnetism is ensured not to change; and during the above-describedmeasurement the magnetoresistive element must be heated or cooled withina short period of time.

However, if the above-mentioned magnetoresistive element is heated by anordinary heating/cooling apparatus, not only the magnetoresistiveelement, but the entire magnetic sensor, including a substrate of themagnetoresistive element, is heated/cooled. Therefore, heating/coolingtime would be long due to the large heat capacity of the magneticsensor, and consequently geomagnetism would change during measurement ofthe temperature dependence. As a result, a problem would arise, in thatthe reliability of the temperature-dependent characteristic stored inthe memory would be lowered, and consequently precise compensation ofthe temperature-dependent characteristic would be impossible. Althoughone feasible solution is to measure the temperature-dependentcharacteristic under an environment free from the influence ofgeomagnetism, an apparatus (magnetic field canceller) for establishingsuch environment is extremely expensive, thereby introducing anotherproblem of increasing the manufacturing cost of the magnetic sensor.

Accordingly, an object of the present invention is to provide a magneticsensor, which is capable of measuring a temperature-dependentcharacteristic inexpensively, within a short period of time, and withprecision, and to provide a method for precisely compensating atemperature-dependent characteristic of a magnetic sensor.

Another object of the present invention is to provide a single-chipmagnetic sensor which can generate an output signal of the magneticsensor without using a connecting wire; e.g., an Au wire for connectingthe magnetic sensor to external parts (for instance an externalcircuit).

Still another object of the present invention is to provide a magneticsensor in which external noise exerts substantially no influence on acontrol circuit section which performs various operations such asgeneration of an output signal on the basis of a change in resistance ofa magnetoresistive element, obtainment of data regarding the temperaturecharacteristic of the magnetoresistive element, initialization of themagnetization of the free layer of the magnetoresistive element, andapplication of an external magnetic field to the magnetoresistiveelement for testing the performance of the magnetoresistive element.

A further object of the present invention is to provide a magneticsensor having a structure suitable for fixing magnetization of pinnedlayers of a plurality of magnetoresistive elements in the same directioneasily and reliably.

DISCLOSURE OF THE INVENTION

The present invention provides a magnetic sensor which comprises aplurality of magnetoresistive elements formed on an upper surface of alayer superposed on a substrate, and a plurality of heat generatingelements adapted to generate heat when electrically energized, andwhich, on the basis of resistance values of the plurality ofmagnetoresistive elements, generates an output value corresponding to anexternal magnetic field acting on the magnetoresistive elements, whereinthe plurality of heat generating elements are arranged and configured insuch a way that, when each of the plurality of heat generating elementsgenerates a quantity of heat approximately equal to the quantity of heatgenerated by any of the remaining heat generating elements, thetemperatures of the plurality magnetoresistive elements becomeapproximately equal to one another, and the temperature of the uppersurface of the layer on which the plurality of magnetoresistive elementsare formed becomes nonuniform (uneven). Examples of the magnetoresistiveelements include MR elements, GMR elements, and TMR elements.

By virtue of the above-described arrangement and configuration, theentire magnetic sensor including the substrate is not heated to the sametemperature; and the plurality of magnetoresistive elements are heatedto approximately the same temperature (a temperature different from thesubstrate temperature). Thus, it becomes possible to shorten the periodof time required for heating/cooling the magnetoresistive elements, sothat the temperature-dependent characteristics of the magnetoresistiveelements can be measured within a period of time in which the samegeomagnetism acts on the magnetoresistive elements.

In this case, the plurality of magnetoresistive elements may be arrangedto form a plurality of island-like element groups, each including aplurality of magnetoresistive elements which are identical in magneticfield detecting direction and arranged adjacent to each other on theupper surface of the layer; and the heat generating elements may beformed such that one is located above or beneath each element group. Inthis case, because the heating members can heat mainly themagnetoresistive elements, the period of time required forheating/cooling can be further shortened.

Preferably, each of the heat generating elements assumes the form of acoil (heating coil) capable of applying to the magnetoresistive elementsformed above or beneath the heat generating element a magnetic field ina direction approximately identical with or approximately perpendicularto the magnetic field detecting direction of the magnetoresistiveelements. In this case, the magnetic field whose direction isapproximately identical with the magnetic field detecting direction ofthe magnetoresistive elements can be used as a test magnetic field fordetermining whether or not the magnetic sensor properly detects amagnetic field; and the magnetic field whose direction is approximatelyperpendicular to the magnetic field detecting direction of themagnetoresistive elements can be used as, for example, a magnetic fielddedicated to initialization of the free layers of the magnetoresistiveelements.

By virtue of this preferable structure, because the heat generatingelement (heating coil) can serve also as a coil (test coil orinitialization coil) for generating a magnetic field whose direction isapproximately identical with or approximately perpendicular to themagnetic field detecting direction of the magnetoresistive element, itbecomes possible to minimize the cost of the magnetic sensor as a resultof shortening the manufacturing process and reducing the number of masksused in the manufacturing process. Further, when this coil iselectrically energized, measurement of the temperature-dependentcharacteristic of the magnetic sensor, a portion or entirety of testingof the magnetic sensor, and a portion or entirety of initialization ofthe magnetic sensor can be carried out simultaneously; therefore, themanufacturing (test) period of time can be shortened, thereby reducingmanufacturing cost.

The present invention also provides a magnetic sensor which comprises aplurality of magnetoresistive elements formed on an upper surface of alayer superposed on a substrate, and a single heat generating elementfor generating heat when electrically energized, and which generates anoutput value corresponding to an external magnetic field acting on themagnetoresistive elements, on the basis of resistance values of theplurality of magnetoresistive elements, wherein the heat generatingelement is arranged and configured in such a manner that thetemperatures of the plurality of magnetoresistive elements becomeapproximately equal to one another, and that the temperature of theupper surface of the layer on which the plurality of magnetoresistiveelements are formed becomes nonuniform.

By virtue of this alternative configuration as well, the entire magneticsensor including the substrate is not heated to the same temperature;and the plurality of magnetoresistive elements are heated toapproximately the same temperature (a temperature different from thesubstrate temperature). Thus, it becomes possible to shorten the periodof time required for heating/cooling the magnetoresistive elements, sothat the temperature-dependent characteristics of the magnetoresistiveelements can be measured within a period of time in which the samegeomagnetism acts on the magnetoresistive elements.

In this case, the heat generating element and the plurality ofmagnetoresistive elements may be configured in such a manner that thequantity of heat to be propagated from the heat generating element to anarbitrary one of the plurality of magnetoresistive elements becomesapproximately identical with the quantity of heat to be propagated fromthe heat generating element to one of the remaining magnetoresistiveelements.

The heat generating element and the plurality of magnetoresistiveelements may be configured in such a manner that a relative positionalrelation between the heat generating element and an arbitrary one of theplurality of magnetoresistive elements becomes approximately identicalwith the relative positional relation between the heat generatingelement and one of the remaining magnetoresistive elements.

Preferably, the plurality of magnetoresistive elements are arrangedseparately in four islands spaced from one another on the upper surfaceof the layer superposed on the substrate, and are formed in such a waythat, when the plurality of magnetoresistive elements are rotated withina plane parallel to the upper surface of the layer through 90° about acentroid of a quadrilateral figure defined by four straight lines eachinterconnecting approximate centers of adjacent islands, an arbitraryone of the islands becomes substantially aligned with a position whichbefore the angular movement through 90° had been occupied by anotherisland that is adjacent to the arbitrary island in the direction of theangular movement.

Further, the magnetic sensor having any of the above-mentioned featuresmay further comprise a temperature detecting section that outputs, as adetection temperature, a temperature having a constant correlation withthe temperature of at least one of the plurality of magnetoresistiveelements when the temperatures of the plurality of magnetoresistiveelements become approximately equal to one another, and the temperatureof the upper surface of the layer on which the plurality ofmagnetoresistive elements are formed becomes nonuniform.

As described above, the magnetoresistive elements are heated toapproximately the same temperature as a result of heat radiation of theheat generating element(s). Therefore, in the case in which thetemperature detecting section has a constant correlation with at leastone of the plurality of magnetoresistive elements in terms oftemperature, the temperature detecting section can detect thetemperatures of substantially all the magnetoresistive elements of thesame configuration. Therefore, according to the above-mentionedconfiguration, the temperature detecting section is not required to beincreased in number, and thus the cost of the magnetic sensor can bereduced.

Further, in the magnetic sensor including the above-mentionedtemperature detecting section, preferably, the plurality ofmagnetoresistive elements are interconnected in such a way that, amongthe magnetoresistive elements, elements identical in magnetic fielddetecting direction constitute a bridge circuit in order to generate anoutput value corresponding to said external magnetic field; and themagnetic sensor further comprises a memory, and temperature-dependentcharacteristic writing means for writing into the memory a value that isdetermined on the basis of “data representing a first temperature of themagnetoresistive elements, determined on the basis of the detectiontemperature output from the temperature detecting section, and a firstoutput value output from the magnetic sensor at the first temperature,”and “data representing a second temperature of the magnetoresistiveelements, different from the first temperature and determined on thebasis of the detection temperature output from the temperature detectingsection, and a second output value output from the magnetic sensor atthe second temperature,” the value to be written into the memorycorresponding to a ratio of a difference between the first and secondoutput values to a difference between the first and second temperatures.

The temperature-dependent characteristic of a magnetic sensor in which aplurality of magnetoresistive elements constitutes a bridge circuit(full-bridge circuit) is such that the output of the magnetic sensorchanges in proportion to the variation in temperature of themagnetoresistive element. Therefore, if a value corresponding to theabove-described “ratio” (i.e., variation in output value of the magneticsensor with respect to variation in temperature of the magnetoresistiveelement), which value may be the ratio itself, the inverse of the ratio,etc., is stored in advance in a memory, an electronic apparatus canobtain data of the temperature-dependent characteristic of the magneticsensor by reading the “ratio” from the memory after the magnetic sensoris mounted in the electronic apparatus. Therefore, the data can be usedto compensate the temperature-dependent characteristic of the magneticsensor.

In other words, data regarding the temperature-dependent characteristicof each magnetic sensor can be held in the magnetic sensor through asimple operation of storing a value corresponding to the above-described“ratio” in the memory of the magnetic sensor. Therefore, it is possibleto minimize the capacity of the memory in which data of thetemperature-dependent characteristic of the magnetic sensor is to bestored, thereby lowering the cost of the magnetic sensor.

The present invention further provides a method of compensating atemperature-dependent characteristic of a magnetic sensor which includesa magnetoresistive element whose resistance varies according to anexternal magnetic field, a first memory, a temperature detecting sectionfor outputting, as a detection temperature, a temperature having aconstant correlation with the temperature of the magnetoresistiveelement, and a heat generating element for generating heat whenelectrically energized; and which generates an output valuecorresponding to the external magnetic field on the basis of aresistance value of the magnetoresistive element; the magnetic sensorbeing adapted for incorporation in an electronic apparatus whichincludes a permanent magnet component, a casing, and a second memory,wherein the casing accommodates the magnetic sensor, the permanentmagnet component, and the second memory; the method comprising the stepsof: obtaining a first temperature of said magnetoresistive element onthe basis of the detection temperature output from said temperaturedetecting section, and obtaining a first output value output from saidmagnetic sensor at the first temperature, before said magnetic sensor isaccommodated in said casing; changing the electrically energized stateof said heat generating element, before said magnetic sensor isaccommodated in said casing; obtaining a second temperature of saidmagnetoresistive element on the basis of the detection temperatureoutput from said temperature detecting section, and obtaining a secondoutput value output from said magnetic sensor at the second temperature,before said magnetic sensor is accommodated in said casing; storing intothe first memory a value corresponding to a ratio of a differencebetween the first and second output values to a difference between thefirst and second temperatures; storing into the second memory, asreference data, an offset value of the output value of the magneticsensor and a detection temperature output from the temperature detectingsection after the magnetic sensor is accommodated in the casing togetherwith the permanent magnet component; and thereafter, correcting theoutput value of the magnetic sensor on the basis of the valuecorresponding to the ratio stored in the first memory, the referencedata stored in the second memory, and the detection temperature outputfrom the temperature detecting section.

By this method, data to obtain a value corresponding to theabove-described “ratio,” serving as data representing thetemperature-dependent characteristic of the magnetic sensor, is obtainedand/or stored into the first memory in a stage in which the magneticsensor has not yet been mounted in an electronic apparatus. Then, afterthe magnetic sensor is accommodated in the casing together with thepermanent magnet component and the second memory, an offset value of theoutput value of the magnetic sensor and a temperature detected by thetemperature detecting section when the offset value is obtained arestored into the second memory. Subsequently, the actual output value ofthe magnetic sensor is corrected on the basis of a difference between anactual temperature detected by the temperature detecting section and thetemperature stored in the second memory, the value corresponding to the“ratio” and stored in the first memory, and the offset value stored inthe second memory.

Note that said storing into the first memory the value corresponding tothe ratio may be carried out even after the magnetic sensor isaccommodated in the casing.

This method will be described by use of a specific example. Thedifference between an actual temperature detected by the temperaturedetection section and the temperature stored in the second memory ismultiplied by the “ratio” stored in the first memory so as to obtain anamount of change in offset value resulting from variation in temperatureof the magnetic sensor. Subsequently, the offset value stored in thesecond memory is added to the amount of change in offset value so as toobtain an after-temperature-change offset value; and a differencebetween the actual output value of the magnetic sensor and theafter-temperature-change offset value is used as a value correspondingto an external magnetic field to be detected.

Thus, according to the temperature-dependent characteristic compensatingmethod of the present invention, a value according to theabove-described “ratio” is measured in a stage in which the magneticsensor has not yet been mounted in an electronic apparatus, and storedinto the first memory. Therefore, the magnetic sensor itself can possessdata representing the temperature-dependent characteristic of themagnetic sensor. Further, because the offset value and the detectiontemperature output from the temperature detecting section are storedinto the second memory after the magnetic sensor is mounted in thecasing of an electronic apparatus together with the permanent magnetcomponent, there is no need to store into the first memory the offsetvalue of the magnetic sensor itself and the detection temperature outputfrom the temperature detection section when the offset value isobtained. Therefore, the storage capacity of the first memory can beminimized to thereby lower the cost of the magnetic sensor. Moreover,since two types of offsets of the magnetic sensor; i.e., an offset(reference shift) of the magnetic sensor itself stemming from theindividual difference (difference in resistance value) of themagnetoresistive element and an offset (reference shift) attributable toa leakage magnetic field from the permanent magnet component, can beobtained simultaneously after the magnetic sensor is mounted in thecasing, there is no need to obtain the offset value twice. Thus,according to the present invention, the temperature-dependentcharacteristic of the magnetic sensor can be compensated in a simplemanner.

The present invention also provides a magnet sensor comprising a singlesubstrate, a plurality of magnetoresistive elements, a wiring sectioninterconnecting the plurality of magnetoresistive elements, and acontrol circuit section for obtaining via the wiring section a physicalquantity determined on the basis of resistance values of the pluralityof magnetoresistive elements and processing the physical quantity so asto generate an output signal to be output to the outside, wherein themagnetic sensor further includes a plurality of layers superposed on thesubstrate; the magnetoresistive elements are formed on an upper surfaceof one of the plurality of layers; the wiring section and the controlcircuit section are formed in the substrate and the plurality of layers;and the magnetoresistive elements, the wiring section, and the controlcircuit section are interconnected in the plurality of layers by aconnection section formed of a conductive substance and extending alonga direction intersecting layer surfaces of the layers.

By virtue of this structure, the magnetoresistive elements, the wiringsection, and the control circuit section are interconnected within theplurality of layers, without crossing, by the connection section whichis formed of a conductive substance and extends along a directionintersecting the layer surfaces of the layers. Thus, there is provided asingle-chip magnetic sensor which can generate an output signal of themagnetic sensor, without use of a connecting wire, unlike a magneticsensor in which the chip is divided into a chip which carriesmagnetoresistive elements and a chip which carries a control circuitsection, etc, and in which a connecting wire is used to connect thechips.

Further, the present invention provides a magnetic sensor comprising asubstrate, a plurality of magnetoresistive elements disposed at an upperportion of the substrate, a wiring section disposed at the upper portionof the substrate and interconnecting the plurality of magnetoresistiveelements, and a control circuit section for obtaining via the wiringsection a physical quantity determined on the basis of resistance valuesof the plurality of magnetoresistive elements and processing thephysical quantity so as to generate an output signal to be output to theoutside, wherein the plurality of magnetoresistive elements are disposedat a peripheral portion of the substrate as viewed in plan; the wiringsection is disposed so as to form substantially a closed curve as viewedin plan; and the control circuit section is disposed substantiallyinside the closed curve as viewed in plan.

By virtue of this configuration, the control circuit section forperforming, for example, the generation of an output signal on the basisof a change in resistance of the magnetoresistive element or theobtaining of data of temperature characteristic of the magnetoresistiveelement, can be disposed within a compact space at the central portionof the substrate as viewed in plan. Therefore, the length of wiring inthe control circuit section is shortened, and hence external noise canhardly be superposed on the wiring. As a result, there is provided amagnetic sensor which is hardly affected by external noise and is highlyreliable.

Further, the present invention provides a magnetic sensor comprising asingle substrate and a plurality of element groups, each element groupincluding a pair of magnetoresistive elements which are identical interms of magnetization direction of a pinned layer, wherein each of theplurality of element groups is disposed at an upper portion of thesubstrate in such a way that the magnetization direction of the pinnedlayer of each element group is substantially parallel to a direction inwhich a distance from a centroid (center) of the substrate increases,and such that the pair of magnetoresistive elements are disposedadjacent to each other in the last-named direction.

When the direction of magnetization of the pinned layer is being fixed,a magnetic field of stabilized direction and magnitude must becontinually applied to the magnetoresistive element. At this time, attwo neighboring points on the same line of magnetic force, the magneticfield assumes approximately the same magnitude in approximately the samedirection. Further, in a magnetic sensor, on many occasions, in order toimprove the temperature characteristic etc. of the magnetic sensor, aplurality of element groups each including a pair of magnetoresistiveelements of identical pinned-layer magnetization direction (i.e., ofidentical magnetic field detecting direction) are provided, and thesemagnetoresistive elements are bridge-interconnected.

Therefore, in the case of the magnetic sensor configured in theabove-described manner in which each of the plurality of element groupsis disposed at an upper portion of the substrate such that theabove-described pinned-layer magnetization direction is substantiallyparallel to the direction in which the distance from the centroid(center) of the substrate increases, as viewed in plan, and such thatthe pair of magnetoresistive elements are disposed adjacent to eachother in that direction, when a magnetic field directed from thecentroid (center) of the substrate toward its periphery acts on themagnetic sensor, magnetization of the pinned layer of themagnetoresistive elements can be fixed, by virtue of the magnetic fieldhaving the same magnitude and the same direction. As a result, thepinned layers of the magnetoresistive elements can be magnetized in thesame direction easily and reliably.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic plan view of a magnetic sensor according to afirst embodiment of the present invention;

FIG. 2 is a schematic plan view of a portion of the magnetic sensor ofFIG. 1, showing an electrical wiring state of the magnetic sensor;

FIG. 3 is a schematic cross-sectional view of a portion of the magneticsensor of FIG. 1, taken along a predetermined plane perpendicular to thesurfaces of individual layers constituting the magnetic sensor;

FIG. 4 is a graph showing variations in the resistance value of a GMRelement of FIG. 1 with respect to an external magnetic field;

FIG. 5 is a schematic plan view of a magnetic sensor according to amodification of the first embodiment;

FIG. 6 is an enlarged plan view of a portion of the magnetic sensor ofFIG. 1;

FIG. 7 is an equivalent circuit diagram of an X-axis magnetic sensor ofthe magnetic sensor of FIG. 1;

FIG. 8 is a graph showing variations in the output voltage (outputsignal) of the X-axis magnetic sensor constituting the magnetic sensorof FIG. 1, with respect to an external magnetic field;

FIG. 9 is a front view of a cellular phone on which the magnetic sensorof FIG. 1 is to be mounted;

FIG. 10 is a graph showing a temperature-dependent characteristic of theX-axis magnetic sensor constituting the magnetic sensor of FIG. 1;

FIG. 11 is a graph showing a temperature-dependent characteristic of aY-axis magnetic sensor which constitutes a portion of the magneticsensor of FIG. 1;

FIG. 12 is a schematic plan view of the magnetic sensor of FIG. 1,showing isothermal lines when heating coils of the magnetic sensor areenergized;

FIG. 13 is a graph showing a relation between the lapse of time fromelectrical energization of the heating coils of the magnetic sensor ofFIG. 1 and the variation in temperature of the GMR element;

FIG. 14 is a schematic plan view of a magnetic sensor according to asecond embodiment of the present invention;

FIG. 15 is a cross-sectional view of a portion of the magnetic sensor,taken along 1-1 line in FIG. 14;

FIG. 16 is a schematic plan view of the magnetic sensor of FIG. 14,showing isothermal lines when heating coils of the magnetic sensor areelectrically energized;

FIG. 17 is a schematic plan view of a magnetic sensor according to amodification of the second embodiment of the present invention, showingisothermal lines when heating coils of the magnetic sensor areelectrically energized; and

FIG. 18 is a schematic cross-sectional view of another modification ofthe magnetic sensor according to the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION FIRST EMBODIMENT

Embodiments of a magnetic sensor according to the present invention willnow be described with reference to the accompanying drawings. FIG. 1 isa schematic plan view of a magnetic sensor 10 according to a firstembodiment; FIG. 2 is a schematic plan view of a portion of the magneticsensor 10, showing the electrical wiring of the magnetic sensor 10; andFIG. 3 is a schematic cross-sectional view of a portion of the magneticsensor shown in FIGS. 1 and 2, taken along a predetermined planeperpendicular to the surfaces of individual layers constituting themagnetic sensor 10.

The magnetic sensor 10 includes a substrate 10 a which is formed ofSi₃N₄/Si, SiO₂/Si, or quartz glass and which has an approximately square(or rectangular) shape with sides extending along mutually perpendicularX- and Y-axes and has a small thickness in a Z-axis directionperpendicular to the X- and Y-axes; layers INS1 and S1-S3 superposed onthe substrate 10 a and identical in shape with the substrate 10 a asviewed in plan; a total of eight GMR elements 11-18 formed on (an uppersurface of) the layer S3 as magnetoresistive elements; and a passivationlayer PL formed as an uppermost surface.

As shown in FIG. 1, the magnetic sensor 10 has a bridge wiring section(connection wire section) 19 bridge-interconnecting the GMR elements11-14 and the GMR elements 15-18, respectively, to constitute twofull-bridge circuits; heating coils 21-24 serving as heating elementsfor heating the GMR elements 11-18; a control circuit section (LSI) 31;a temperature detecting section 32; test coils 33 a-33 d; and pads 34a-34 h for connecting the magnetic sensor 10 with external equipment viaAu wires bonded to the upper surfaces of the pads.

The GMR element 11 is called the first X-axis GMR element 11 and, asshown in FIG. 1, is formed on the substrate 10 a in the vicinity of theapproximate center of a left-hand side of the substrate 10 a extendingalong the Y-axis direction. The GMR element 12 is called the secondX-axis GMR element 12 and is disposed in the vicinity of the approximatecenter of the left-hand side of the substrate 10 a in such a manner thatthe second X-axis GMR element 12 is located adjacent to (neighboring)the first X-axis GMR element 11 at a position spaced a short distance inthe positive X-axis direction from the first X-axis GMR element 11.

The GMR element 13 is called the third X-axis GMR element 13 and isformed on the substrate 10 a in the vicinity of the approximate centerof a right-hand side of the substrate 10 a extending along the Y-axisdirection. The GMR element 14 is called the fourth X-axis GMR element 14and is disposed in the vicinity of the approximate center of theright-hand side of the substrate 10 a in such a manner that the fourthX-axis GMR element 14 is located adjacent to (neighboring) the thirdX-axis GMR element 13 at a position spaced a short distance in thenegative X-axis direction from the third X-axis GMR element 13.

The GMR element 15 is called the first Y-axis GMR element 15 and isformed on the substrate 10 a in the vicinity of the approximate centerof the upper side of the substrate 10 a extending along the X-axisdirection. The GMR element 16 is called the second Y-axis GMR element 16and is disposed in the vicinity of the approximate center of the upperside of the substrate 10 a in such a manner that the second Y-axis GMRelement 16 is located adjacent to (neighboring) the first Y-axis GMRelement 15 at a position spaced a short distance in the negative Y-axisdirection from the first Y-axis GMR element 15.

The GMR element 17 is called the third Y-axis GMR element 17 and isformed on the substrate 10 a in the vicinity of the approximate centerof the lower side of the substrate 10 a extending along the X-axisdirection. The GMR element 18 is called the fourth Y-axis GMR element 18and is disposed in the vicinity of the approximate center of the lowerside of the substrate 10 a in such a manner that the fourth Y-axis GMRelement 18 is located adjacent to (neighboring) the third Y-axis GMRelement 17 at a position spaced a short distance in the positive Y-axisdirection from the third Y-axis GMR element 17.

A spin valve layer constituting each of the GMR elements 11-18 includesa free layer, a conductive spacer layer, a pin layer (fixedmagnetization layer), and a capping layer which are superposed (formed)one over another on the upper surface of the layer S3 on the substrate10 a. The magnetization direction of the free layer changes freely inaccordance with variation in the external magnetic field. The pin layerincludes a pinning layer and a pinned layer; the magnetization directionof the pinned layer is fixed by the pinning layer and does not changewith respect to the external magnetic field except in a special case.

Each of the GMR elements 11-18 thereby assumes a resistance valuecorresponding to an angle between the pinned-layer magnetizationdirection and the free layer magnetization direction. Namely, each ofthe GMR elements 11-18, as indicated by solid lines in the graph of FIG.4, assumes a resistance value which varies within the range of −Hc to+Hc approximately in proportion to an external magnetic field varying inthe pinned-layer magnetization direction; and, as indicated by dottedlines, assumes a resistance value which is approximately constant for anexternal magnetic field varying in the direction perpendicular to thepinned-layer magnetization direction. In other words, each of the GMRelements 11-18 is such that the pinned-layer magnetization direction isidentical with the magnetic field detecting direction.

The pinned-layer magnetization direction of each of the GMR elements 11and 12 is the negative X direction. Namely, the first and second X-axisGMR elements 11 and 12 form one element group Gr1 in which a pluralityof magnetoresistive elements which detect the magnitude of a magneticfield in the same direction (in this case the X direction); i.e., whichhave the same magnetic field detecting direction, are located adjacentto one another in the form of an island on the layer S3 superposed onthe substrate 10 a.

The pinned-layer magnetization direction of each of the GMR elements 13and 14 is the positive X direction. Namely, the third and fourth X-axisGMR element 13 and 14 form another element group Gr2 in which aplurality of magnetoresistive elements for detecting the magnitude of amagnetic field in the same direction (in this case the X direction) arelocated adjacent to one another in the form of an island on the layer S3superposed on the substrate 10 a.

The pinned-layer magnetization direction of each of the GMR elements 15and 16 is the positive Y direction. Namely, the first and second Y-axisGMR elements 15 and 16 form still another element group Gr3 in which aplurality of magnetoresistive elements for detecting the magnitude of amagnetic field in the same direction (in this case the Y direction) arelocated adjacent to one another in the form of an island on the layer S3superposed on the substrate 10 a.

The pinned-layer magnetization direction of each of the GMR elements 17and 18 is the negative Y direction. Namely, the third and fourth Y-axisGMR element 17 and 18 form a further element group Gr4 in which aplurality of magnetoresistive elements for detecting the magnitude of amagnetic field in the same direction (in this case the Y direction) arelocated adjacent to one another in the form of an island on the layer S3superposed on the substrate 10 a.

Thus, the GMR elements 11-18 form four element groups (islands) Gr1-Gr4in which two neighboring magnetoresistive elements of each element groupare identical in terms of magnetic field detecting direction. Theseelement groups Gr1-Gr4 are disposed outside the approximate centerpositions of the respective sides of a square (sides of the squarebridge wiring section 19 as viewed in plan) having sides along the X andY directions as viewed in plan, and are formed in such a way that, whenan arbitrary element group is angularly moved through 90° about acentroid of the square (the center of the square; i.e., the intersectionpoint of diagonal lines of the square), the arbitrary element groupbecomes substantially aligned with a position that before the angularmovement through 90° had been occupied by another, neighboring elementgroup. In other words, the plurality of GMR elements 11-18 are disposedin four spaced islands on the upper surface of the layer S3 superposedon the substrate 10 a, and are formed in such a manner that, when theplurality of magnetoresistive elements 11-18 are angularly moved in aplane parallel to the upper surface of the layer S3 through 90° aboutthe centroid GP of a quadrangle formed by four straight linesinterconnecting approximate centers of adjacent pair of the islands, anarbitrary one of the islands becomes substantially aligned with aposition before the angular movement through 90° had been occupied byanother, neighboring island in the direction of the angular movement.Namely, assuming not only that four straight lines (line segments);i.e., a straight line interconnecting the approximately central portionsof the element groups Gr2 and Gr3, a straight line interconnecting theapproximately central portions of the element groups Gr3 and Gr1, astraight line interconnecting the approximately central portions of theelement groups Gr1 and Gr4, and a straight line interconnecting theapproximately central portions of the element groups Gr4 and Gr2, areobtained, but also that, when the element groups are angularly movedthrough 90° about the centroid of a quadrangle formed by these linesegments, each element group becomes aligned with the position thatbefore the angular movement had been occupied by another, neighboringelement group; namely, the element group Gr2 becomes aligned with theformer position of the element group Gr3, the element group Gr3 becomesaligned with the former position of the element group Gr1, and so forth.

In the example shown in FIGS. 1 through 3, two GMR elements constitutinga single island (a single element group) are located adjacent to eachother in the direction from the center (centroid, which is aligned withthe above-mentioned centroid GP) of the substrate 10 a toward one side(periphery) of the substrate 10 a. Namely, each of the plurality ofelement groups Gr1-Gr4 each including a pair of magnetoresistiveelements of identical magnetic field detecting direction is disposed atthe upper portion of the substrate 10 a in such a way that thepinned-layer magnetization directions of the magnetoresistive elementsbecome substantially parallel to the direction in which a distance fromthe centroid of the substrate 10 a increases, as viewed in plan, andsuch that the above-mentioned pair of magnetoresistive elements aredisposed adjacent to each other in the same direction. Alternatively, asshown in FIG. 5, a pair of magnetoresistive elements may be disposedadjacent to each other in the direction along one side of the substrate10 a. However, according to the former arrangement, because the GMRelements come closer to the centers of the respective sides of the(square) substrate 10 a as compared with the latter arrangement, thecharacteristics of the elements can easily become uniform. Further, inthe case of the former, a magnetic field having the same magnitude inthe same direction can be easily applied to a pair of magnetoresistiveelements as compared with the latter case.

As exemplified in FIG. 6, which is an enlarged plan view of an area inthe vicinity of the GMR elements 11 and 12, the GMR elements 11-14 areconnected to the respective wires of the bridge wiring section 19, tothereby constitute a bridge circuit (full-bridge connected) through themedium of the bridge wiring section 19 as shown in an equivalent circuitdiagram of FIG. 7, thereby constituting the X-axis magnetic sensor whosemagnetic field detecting direction is the X direction. In FIG. 7, anarrow labeled in each GMR element 11-14 indicates the pinned-layermagnetization direction of the respective GMR element 11-14.

More specifically, the X-axis magnetic sensor is such that, when aconstant potential difference is applied between a junction Va betweenthe first and fourth X-axis GMR elements 11 and 14 and a junction Vbbetween the third and second X-axis GMR elements 13 and 12, a potentialdifference (Vc-Vd) between a junction Vc between the first and thirdX-axis GMR elements 11 and 13 and a junction Vd between the second andfourth X-axis GMR elements 12 and 14 is derived as a sensor output valueVxout. As a result, the output voltage (physical quantity represented byvoltage) of the X-axis magnetic sensor changes approximately inproportion to the magnitude of an external magnetic field within therange of −Hc to +Hc, which magnitude varies along the X-axis, asindicated by solid lines in FIG. 8; and remains at a constant value ofapproximately “0” for an external magnetic field whose magnitude variesalong the Y-axis.

Similar to the case of the GMR elements 11-14, the GMR elements 15-18are connected to the respective wires of the bridge wiring section 19 toconstitute a bridge circuit (full-bridge connected), therebyconstituting the Y-axis magnetic sensor whose magnetic field detectingdirection is the Y-axis direction. Namely, the Y-axis magnetic sensorexhibits an output voltage (physical quantity represented by voltage)Vyout which changes approximately in proportion to the magnitude of anexternal magnetic field within the range of −Hc to +Hc, which magnitudevaries along the Y-axis; and exhibits an output voltage of approximately“0” with respect to an external magnetic field whose magnitude variesalong the X-axis.

As shown in FIG. 1, the bridge wiring section 19 is formed at theperiphery of an approximate square area having sides along the X-axisand Y-axis and located inside the GMR elements 11-18, as viewed in plan,thereby constituting substantially a closed curve (including straightportions). As described in detail later, the bridge wiring section 19 isformed in the layer S3 beneath the GMR elements 11-18.

As shown in FIGS. 1 and 3, heating coils 21-24 are embedded in the layerS3, which functions as a wiring layer, to be located right beneath theelement groups Gr1-Gr4 (in the negative Z direction). The heating coils21-24 are approximately identical with each other in terms of shape andpositional relation with the corresponding element groups Gr1-Gr4.Therefore, in the following description, only the heating coil 21 isdescribed in detail.

The heating coil 21 is a heat generating element formed of, for example,aluminum thin film. When electrically energized, the heating coil 21generates heats to thereby heat the first and second GMR elements 11 and12 (element group Gr1). The heating coil 21 is formed in the layer S3 toface the lower surfaces of the magnetoresistive elements 11 and 12, tothereby be disposed directly below the element group Gr1. Namely, as isunderstood from FIG. 3, the heating coil 21 is embedded and formed inthe layer S3, among the insulating layer INS1 and the layers S1-S3superposed one over another on the substrate 10 a, on which layer theGMR elements 11-18 are formed (the uppermost layer S3 among the layersS1-S3 each functioning as a wiring layer). In the present description, alayer functioning as a wiring layer refers to wires, an interlayerinsulating layer between wires, and contact holes (including via-holes)for establishing connection between wires.

Further, as shown in FIG. 6, the heating coil 21 is a so-calleddouble-spiral coil which is approximately rectangular in shape as viewedin plan and which includes a pair of coiled conductors (i.e., a firstconductor 21-1 having a coil center P1 and a second conductor 21-2having a coil center P2); the Y-direction length of the rectangularshape is approximately two times the longitudinal length of themagnetoresistive element 11 (12), and the X-direction length of therectangular shape is approximately five times the transverse (directionperpendicular to the longitudinal direction) length of themagnetoresistive element 11 (12).

In addition, the first and second X-axis GMR elements 11 and 12 arelocated between the two coil centers P1 and P2 as viewed in plan.Further, portions of the first and second conductors 21-1 and 21-2 whichoverlap the first and second X-axis GMR elements 11 and 12 (i.e.,portions extending directly under the first and second X-axis GMRelements 11 and 12) as viewed in plan, extend linearly in parallel toeach other in the X direction. These straight portions of each conductorare adapted to carry a current of the same flow direction and to therebygenerate a magnetic field in the Y-axis direction. Namely, the heatingcoil 21 is adapted to generate a magnetic field in a direction thatcoincides with the longitudinal direction of the first and second X-axisGMR elements 11 and 12, and in the designed direction (directionperpendicular to the fixed direction of magnetization of the pinnedlayer) of magnetization of the free layer in the absence of applicationof any external magnetic field.

As described above, the magnetic sensor 10 according to the firstembodiment is a magnetic sensor including the GMR elements(magnetoresistive elements each including a free layer and a pin layer),and equipped with the heating coils 21-24 which are disposed under (andadjacent to) the free layer and adapted to stabilize (initialize) thedirection of magnetization of the free layer in the absence ofapplication of any external magnetic field and which, when electricallyenergized under a predetermined condition (e.g., before the start ofdetection of magnetism), generates in the free layer a magnetic field(an initializing magnetic field) having a predetermined direction(perpendicular to the pinned-layer magnetization direction). Further,the heating coils 24 are configured in such a manner that whenelectrically energized in a predetermined pattern under a predeterminedcondition, each of the heating coils 21-24 heats the GMR elements (GMRelement group) located directly above.

As shown in FIG. 1, the control circuit section 31 is formed in anapproximate square having sides along the X- and Y-axes to be locatedinward of the bridge wiring section 19 as viewed in plan (inward of asubstantial closed curve outlined by the wiring section 19 or in acenter portion of the substrate 10 a as viewed in plan). As shown inFIG. 3, the control circuit section 31 is formed in the layers INS1,S1-S3 beneath the GMR elements 11-18. The control circuit section 31assumes the form of an LSI including an analog-to-digital converter(ADC), a WORM (write once, read many) memory (hereinafter also called“the first memory” for the sake of convenience) capable of writing dataonce and reading the data many times, and an analog circuit section. Thecontrol circuit section 31 provides various functions such as generationof output signals through obtainment of output values of the X-axismagnetic sensor and Y-axis magnetic sensor (physical quantities detectedin the form of voltage on the basis of resistance values) andprocessing, such as analog-to-digital conversion, of the output values;electrical energization of the heating coils 21-24; obtainment of adetection temperature output from the temperature detecting section 32;obtainment of temperature compensating data; and storage (writing) ofthe data into the first memory.

Because the control circuit section 31 is thus located in the centralportion of the substrate 10 a, the length of wire of the control circuitsection 31 can be shortened. Accordingly, the circuit resistance and thecircuit size itself are reduced, so that the circuit is hardly affectedby noise, and variation in resistance in the circuit (variation amongindividual products) decreases.

As the WORM memory, a fuse-break-type 24-bit memory can be used.Alternatively, a memory (nonvolatile memory), such as an EEPROM or aflash memory, may be used so that data can be written thereinto andretained therein even during shutoff of electric power supply.

The temperature detecting section 32 assumes the form of a conventionalbandgap reference circuit which detects temperature on the basis of thetemperature characteristic of a built-in transistor; and is formed at acorner of the control circuit section 31 inside the bridge wiringsection 19 as viewed in plan. The temperature detecting section 32 islocated in the wiring layer S1 at a position adjacent to the GMRelements 17 and 18 (element group Gr4) rather than to the GMR elements11-16 and is adapted to output a temperature (detection temperature)that always has a constant correlation with the temperature of the GMRelement 18 (element group Gr4). As will described later, because themagnetoresistive elements 11-18 are heated to the same temperature, thetemperature of the other magnetoresistive elements 11-17 can bedetermined by detecting a temperature of only the magnetoresistiveelement 18.

Given that the temperature detecting section 32 is thus located insidethe bridge wiring section 19 at a position adjacent to the element groupGr4, the temperature detecting section 32 can detect a temperature ofthe GMR element 18 with precision. Moreover, because the temperaturedetecting section 32 is connected to the control circuit section 31without crossing the bridge wiring section 19, the length of wirebetween the temperature detecting section 32 and the control circuitsection 31 can be shortened.

The test coils 33 a-33 d are formed in the wiring layer S1 and arelocated directly beneath the respective element groups Gr1-Gr4; FIG. 3shows the test coil 33 a as an example. When electrically energized,each of the test coils 33 a-33 d applies, to one of the magnetoresistiveelements disposed directly above, a magnetic field in the magnetic fielddetecting direction of the respective magnetoresistive element (magneticfield in the pinned-layer magnetization direction).

The magnetic sensor 10 will now be described in terms of layerstructure. As shown in FIG. 3, the upper part of the substrate 10 a isdivided into an element isolation region 10 a 1, and the remainingregion serves as an element activation region 10 a 2. The elementisolation region 10 a 1 is formed on the upper surface of the substrate10 a as a field insulating layer INS (e.g., field oxide) by the LOCOS orSTI technique. The LOCOS technique is a well known technique whichinsulates and separate various elements from one another by means of athermally oxidized layer. The STI technique is a well known techniquecalled shallow-trench element separation and is adapted to separatevarious elements by embedding an oxidized layer in a shallow trench.

Directly above the substrate 10 a and on the upper surface of theinsulating layer INS, an insulating layer INS1 is formed. Within theelement activation region 10 a 2 in the insulating layer INS1, variouscircuit elements such as transistors Tr are formed. Within the elementisolation region 10 a 1 in the insulating layer INS1, various elementssuch as resistors R, fuses, and capacitors are formed. Further, withinthe insulating layer INSI, a plurality of contact holes C1 (connectingportions, vertical connecting portions) electrically connecting circuitelements, such as the transistors Tr, with wires etc. formed in thelayer S1 disposed over the insulating layer INS1, are formedperpendicular to the surfaces of the layers S1-S3 (so as to cross thesurfaces of the layers S1-S3). The contact holes C1 are filled with anelectrically conductive substance.

Over the insulating layer INS1, the layer S1 functioning as the wiringlayer is formed. The layer S1 includes wires W1 in the form of aconductive layer, the test coils 33 a-33 d, an interlayer insulatinglayer IL1, and the temperature detecting section 32. In the interlayerinsulating layer IL1, a plurality of via-holes V1 (connecting portions,vertical connecting portions) for electrical connection with the wiresetc. formed in the upper layer S2 are formed perpendicular to thesurfaces of the layers S1-S3 (so as to cross the surfaces of the layersS1-S3). The via-holes V1 are filled with an electrically conductivesubstance.

Likewise, over the layer S1, the layer S2 functioning as a wiring layeris formed. The layer S2 includes wires W2 in the form of an electricallyconductive layer, and the interlayer insulating layer IL2. In theinterlayer insulating layer IL2, a plurality of via-holes V2 (connectingportions, vertical connecting portions) for electrical connection withthe wires etc. formed in the upper layer S3 are formed perpendicular tothe surfaces of the layers S1-S3 (so as to cross the surfaces of thelayers S1-S3). The via-holes V2 are filled with an electricallyconductive substance.

Also likewise, over the layer S2, the layer S3 functioning as a wiringlayer is formed. The layer S3 includes wires W3 in the form of anelectrically conductive layer, the bridge wiring section 19, the heatingcoils 21 (22-24), and the interlayer insulating layer IL3. In theinterlayer insulating layer IL3, a plurality of via-holes V3 (connectingportions, vertical connecting portions) for electrical connection withthe GMR elements 11-18 formed on the upper surface of the layer S3 areformed perpendicular to the surfaces of the layers S1-S3 (so as to crossthe surfaces of the layers S1-S3). The via-holes V3 are filled with anelectrically conductive substance. The interlayer insulating layer IL3may be a passivation layer which includes nitride film and which differsfrom a passivation layer PL to be described later. In order to maintainthe characteristics of the GMR elements 11-18 at an excellent level, theupper surface of the interlayer insulating layer IL3 is preferablysmoothed. Further, the contact holes C1 and the via-holes V1-V3 areconnecting portions of a conductive substance interconnecting the GMRelements 11-18, the bridge wiring section 19 serving as a wiringsection, the control circuit section 31, etc., and extending in theplurality of layers INS1, S1-S3 in directions intersecting the surfacesthereof.

A pad region PD is a region other than the portion in which the GMRelements 11-18 is formed, the bridge wiring section 19, and the controlcircuit section 31; and is located at a corner of the magnetic sensor 10as viewed in plan (see FIG. 1). The upper surface of the pad region PDconstitutes the above-described pads 34 a-34 h. The pads 34 a-34 h maybe formed only on the uppermost layer S3; but in such a case, the pads34 a-34 h shall bear impact during the bonding of Au wires.Consequently, in the present embodiment, pad sections of approximatesquare shape as viewed in plan are formed across the plurality of layersS1-S3.

The passivation layer PL is formed so as to cover the upper surfaces ofthe layer S3 and those of the GMR elements 11-18. In forming thepassivation layer PL, first a prospective passivation layer is formed soas to cover all of the elements, and then layer portions correspondingto the pads 34 a-34 h are removed. The pads 34 a-34 h are therebyexposed for bonding of the Au wires.

The magnetic sensor 10 is accommodated and mounted in a cellular phone40, which is an example of mobile electronic equipment and whose face isdepicted in the schematic front view of FIG. 9. The cellular phone 40includes a casing (body) 41 which has an approximately rectangular shapehaving sides along perpendicularly intersecting x- and y-axes as viewedin front elevation and whose depth is along the z-axis perpendicular tothe x- and y-axes; an antenna 42 located at an upper side surface of thecasing 41; a speaker 43 located at an uppermost portion of a front sideof the casing 41; a liquid crystal display 44 located at the front sideof the casing 41 downward of the speaker 43 and adapted to displaycharacters and graphics; an operation section (operating signal inputmeans) 45 located at the front side of the casing 41 downward of theliquid crystal display 44 and having switches which are used to input atelephone number or other instruction signals; a microphone 46 locatedat a lowermost portion of the front side of the casing 41; and amicrocomputer 47 which is configured so as to be able to communicatewith the magnetic sensor 10, the display 44, etc. via a bus and whichcomprises a RAM and a backup memory (which may be in the form of anEEPROM, is a memory retaining data even during a shutoff of main powersupply, and is called, for the sake of convenience, “the secondmemory”).

Some or all of the antenna 42, the speaker 43, the liquid crystaldisplay 44, the operation section 45, and the microphone 46 includepermanent magnet components (leakage magnetic field generating elements)as components. The magnetic sensor 10 is accommodated in and fixed tothe casing 41 in such a way that the X-, Y-, and Z-axes of the magneticsensor are aligned with the x-, y-, and z-axes of the casing,respectively.

The manner of compensating the temperature-dependent characteristic ofthe thus-configured magnetic sensor 10 will now be described. Generally,a magnetoresistive element such as a GMR element has atemperature-dependent characteristic such that, for example, theresistance increases with increasing temperature due to the materialcharacteristic of the element; this temperature-dependent characteristicis peculiar to an individual element. Accordingly, the above-describedmagnetic sensor 10 (each of the X-axis magnetic sensor and Y-axismagnetic sensor), comprising a full-bridge circuit of four GMR elements,also has a temperature-dependent characteristic such that the output ofthe magnetic sensor changes with variation in temperature. Thetemperature-dependent characteristics of the individual GMR elementsconstituting the magnetic sensor 10 are classified into two differenttypes; i.e., a type in which the output of the magnetic sensor 10increases with increasing temperature of the GMR element, and anothertype in which the output of the magnetic sensor 10 decreases withincreasing temperature of the GMR element.

FIGS. 10 and 11 are graphs respectively showing the above-mentionedexemplary temperature-dependent characteristics of the magnetic sensor.In the example shown here, the X-axis magnetic sensor has a negativetemperature-dependent characteristic; and the Y-axis magnetic sensor hasa positive temperature-dependent characteristic. In these graphs, solidlines represent output values Vxout and Vyout of the respective magneticsensors when X and Y components of an external magnetic field (e.g., thegeomagnetism in a predetermined site at a predetermined time) are HX0and HY0, respectively; and dash-and-single-dot lines represent outputvalues Vxout and Vyout of the respective magnetic sensors when anexternal magnetic field (e.g., a leakage magnetic field from thepermanent magnet components of the cellular phone 40) in the absence ofany influence of geomagnetism are HX1 and HY1, respectively.

As is understood from FIGS. 10 and 11, the output values Vxout and Vyoutof the magnetic sensor 10 change in approximate proportion to thetemperature of the GMR element with respect to the same magnetic field.Consequently, in the present embodiment, the temperature-dependentcharacteristic is compensated on the assumption that the output valuesVxout and Vyout of the respective magnetic sensor change in proportionto the temperature of the GMR element.

First, when a predetermined condition to obtain data for compensation oftemperature-dependent characteristic is established in response to, forexample, input of an instruction signal from the outside, the controlcircuit section 31 obtains, as a first temperature T1s , a detectiontemperature output from the temperature detecting section 32, whichtemperature corresponds to a current temperature T1 of the GMR element18. At that time, since the entirety of the magnetic sensor 10 is ofuniform temperature (room temperature), the detection temperature T1soutput from the temperature detecting section 32 is equal to thetemperature T1 of the GMR element 18. Simultaneously, the controlcircuit section 31 obtains a current output value X1 of the X-axismagnetic sensor (first output value X1 of the X-axis magnetic sensor)and a current output value Y1 of the Y-axis magnetic sensor (firstoutput value Y1 of the Y-axis magnetic sensor). Then, the controlcircuit section 31 supplies a 100 mA current to the heating coils 21-24in sequence for 100 ms each. The element groups Gr1-Gr4 are therebyheated to approximately the same temperature.

FIG. 12 is a diagram showing isothermal lines on the surface of themagnetic sensor on which the element groups Gr1-Gr4 are formed, bycurves Lh1-Lh4 and Lo1-Lo4. The temperatures Temp at points on eachisothermal line represented by the corresponding curve Lh1-Lh4 areapproximately the same. The temperatures at points on each isothermalline represented by the corresponding curve Lo1-Lo4 are equal to oneanother but lower than the above-mentioned temperature Temp. Thus,because the heating coils 21-24, when electrically energized, heatmainly the corresponding element groups Gr1-Gr4 (disposed directly abovethe respective heating coils) but do not heat the entirety of themagnetic sensor 10 (microchip) uniformly, the upper surface of the layerS3 on which the element groups Gr1-Gr4 are formed are nonuniform intemperature, and such irregular temperatures of the entire upper surfaceof the layer S3 are lower than the temperature of the element groupsGr1-Gr4.

In this state, the control circuit section 31 first obtains a currentdetection temperature output from the temperature detecting section 32as a temperature T2 s, and then calculates a second temperature T2 ofthe GMR element 18 according to a constant correlation between thetemperature output from the temperature detecting section 32 and thetemperature of the GMR element 18, which correlation is expressed by theformula T2=T1 s+k·(T2 s−T1 s) (k is a constant predetermined byexperiments). Additionally, the control circuit section 31 obtains acurrent output value of the X-axis magnetic sensor (second output valueX2 of the X-axis magnetic sensor) and a current output value Y2 of theY-axis magnetic sensor (second output value Y2 of the Y-axis magneticsensor).

Further, the control circuit section 31 calculates gradients Mx and My(quantities of change of output per unit temperature change), which aredetermined by the following formulae (1) and (2), as basic data forcompensation of temperature-dependent characteristic, and writes thegradients Mx and My into the above-described first memory (this functioncorresponding to the function of the temperature-dependentcharacteristic writing means). The gradient Mx is a “ratio” of thedifference between the first and second output values X1 and X2 of theX-axis magnetic sensor to the difference between the first and secondtemperatures T1 and T2; and the gradient My is a “ratio” of thedifference between the first and second output values Y1 and Y2 of theY-axis magnetic sensor to the difference between the first and secondtemperatures T1 and T2.Mx=(X2−X1)/(T2−T1)   (1)My=(Y2−Y1)/(T2−T1)   (2)

By the foregoing procedure, acquisition of the basic data forcompensation of temperature-dependent characteristic is completed in astage in which the magnetic sensor has not yet been mounted in thecellular phone. Subsequently, the magnetic sensor 10 is allowed to standuntil the magnetic sensor 10 is cooled to a sufficient degree, whereuponthe manufacturing process proceeds to the next step. FIG. 13 is a graphshowing a relation between the lapse of time from termination ofelectrical energization of the heating coils 21-24 to obtain theabove-described basic data for compensation of temperature-dependentcharacteristic, and the variation in temperature of the GMR elements11-18.

If the GMR elements 11-18 are caused to experience an analogoustemperature change by use of a conventional heating/cooling unit, theentirety of the magnetic sensor 10 is heated/cooled, which requires anelongated heating period of time. Further, after the termination ofheating, the temperature of the GMR elements 11-18 falls at only a lowrate, so that the required cooling of the GMR elements occasionallytakes several to 20 minutes. In contrast, in the present embodiment,because the element groups Gr1-Gr4 (GMR elements 11-18) are mainlyheated, the period of time required for heating the GMR elements 11-18can be shortened. Moreover, because the temperature of the GMR elements11-18 falls at an increased rate (higher rate) after the termination ofheating, the required cooling is completed in about several seconds, asshown in FIG. 13. Therefore, the basic data for compensation oftemperature-dependent characteristic can be obtained within a shortperiod of time, and the manufacturing process can proceed to the nextstep within a short period of time after the above-described basic datais obtained.

Subsequently, upon completion of the steps necessary for manufacturingthe magnetic sensor 10, the magnetic sensor 10 is mounted (accommodated)in the casing 41 of the cellular phone 40 equipped with a permanentmagnet component such as the speaker 43, and is used as a geomagnetismsensor. As a result, a leakage magnetic field of a constant direction iscontinually applied from the permanent magnet component to the magneticsensor 10 of the cellular phone 40 (irrespective of the direction of thecellular phone 40) and, therefore, the output of the magnetic sensor 10suffers an offset (shift from zero in the case of no geomagnetism) dueto the leakage magnetic field. Further, since the X-axis magnetic sensorand the Y-axis magnetic sensor are in the form of a full-bridge circuit,the output of either magnetic sensor also contains an offset as a resultof the variation in resistance values (although, the values are designedto be identical each other) of the magnetoresistive elementsconstituting the magnetic sensor.

At that time, the output value of the X-axis magnetic sensor of themagnetic sensor 10 changes in proportion to the temperature T of the GMRelements 11-14 constituting the X-axis magnetic sensor, as indicated bythe dash-and-single-dot line in FIG. 10. In this case, the slope(gradient) of the dash-and-single-dot straight line of FIG. 10 isidentical with the slope of the solid straight line of FIG. 10.Likewise, the output value of the Y-axis magnetic sensor of the magneticsensor 10 changes in proportion to the temperature T of the GMR elements15-18 constituting the Y-axis magnetic sensor as indicated by thedash-and-single-dot straight line of FIG. 10. In this case as well, theslope of the dash-and-single-dot straight line is identical with theslope of the solid straight line of FIG. 11.

When a predetermined condition (offset obtaining condition) isestablished in response to, for example, operation of the operationsection 45 of the cellular phone 40 by the user, the microcomputer 47 ofthe cellular phone 40 obtains data (offset values) of the offset of themagnetic sensor 10 (X-axis magnetic sensor, Y-axis magnetic sensor) dueto the leakage magnetic field and the variations in resistance values ofthe magnetoresistive elements 11-18. In a more specific example, themicrocomputer 47 displays on the liquid crystal display 44 a messagewhich prompts the user first to place the cellular phone 40 on the topof a desk with its front side facing upward (i.e., with the front sideof the cellular phone 40 assuming an approximately horizontal postureand the display 44 facing vertically upward) and then to push down anoffset button, which is a specific button, of the operation section 45until the offset button assumes an “ON” state.

When the user performs the above-mentioned operation, the microcomputer47 obtains the respective output values of the X- and Y-axis magneticsensors as X-axis first reference data Sx1 and Y-axis first referencedata Sy1, and stores/memorizes these data into a temporary memory (e.g.,RAM) associated with the microcomputer 47.

Then, the microcomputer 47 displays on the display 44 a message whichprompts the user to rotate the cellular phone 40 through 180° on the topof the desk (i.e., in a horizontal plane) with its front side facingupward and to push the offset button again. When the user performs thisoperation, the microcomputer 47 obtains the respective output values ofthe X- and Y-axis magnetic sensors as X-axis second reference data Sx2and Y-axis second reference data Sy2 and stores/memorizes these datainto the temporary memory.

Also, the microcomputer 47 stores/memorizes a mean value between theX-axis first reference data Sx1 and the X-axis second reference data Sx2into the second memory as X-axis offset reference data X0;stores/memorizes a mean value between the Y-axis first reference dataSy1 and the Y-axis second reference data Sy2 into the second memory asY-axis offset reference data Y0; and stores/memorizes a currentdetection temperature T0s of the temperature detecting section 32 intothe second memory as a GMR element temperature T0. The reason forrecording the mean value between the outputs of each magnetic sensorbefore and after the turning of the cellular phone 40 through 180° asthe offset reference data X0 and Y0 is to obtain offset values whileremoving the influence of geomagnetism. Because the magnetic sensor 10is uniform in temperature (room temperature) when the detectiontemperature T0 is obtained, the detection temperature T0 s is equal tothe GMR element temperature T0.

After that, the cellular phone 40 returns to the usual operation modefor use thereof, and measures geomagnetism by the magnetic sensor 10when necessary. At that time, the microcomputer 47 obtains an actualdetection temperature TCs of the temperature detection section 32 as theGMR element temperature TC to thereby estimate a current offset Xoff ofthe X-axis magnetic sensor and a current offset Yoff of the Y-axismagnetic sensor according to the following formulae (3) and (4),respectively. Because the magnetic sensor 10 is uniform in temperature(room temperature) when the detection temperature TCs is obtained, thedetection temperature TCs is equal to the GMR element temperature TC.Xoff=Mx·(TC−T0)+X0   (3)Yoff=My·(TC−T0)+Y0   (4)

Then, the microcomputer 47 obtains a current output value XC of theX-axis magnetic sensor and a current output value YC of the Y-axismagnetic sensor to thereby calculate a magnitude Sx of a magnetic fieldin the X-axis direction and a magnitude Sy of a magnetic field in theY-axis direction by the following formulae (5) and (6), respectively.Upon completion of the compensation of the temperature-dependentcharacteristic of the magnetic sensor 10 carried out in the foregoingmanner, the magnetic sensor 10 functions as a geomagnetism sensor.Sx=XC−Xoff   (5)Sy=YC−Yoff   (6)

As described herein above, according to the magnetic sensor 10 of thefirst embodiment, because mainly the GMR elements 11-18 formed directlyabove the respective heating coils 21-24 are heated by the heating coils21-24 (i.e., a portion of the magnetic sensor 10 including the substrateis heated to a lower temperature than the temperature of themagnetoresistive elements 11-18 that are heated to the sametemperature), the basic data for compensation of temperature-dependentcharacteristic can be obtained within a short time as compared with thecase in which the whole magnetic sensor 10 is heated by a heatingdevice. Therefore, geomagnetism is very unlikely to vary during themeasurement for obtaining the basic data for compensation oftemperature-dependent characteristic; and hence such data can beobtained accurately. Accordingly, the temperature-dependentcharacteristic of the magnetic sensor 10 can be compensated withprecision. Further, since the magnetic sensor 10 can be cooled within ashort time as compared with the case where the magnetic sensor is cooledafter having been heated by a heating device, the period of time neededfor manufacturing the magnetic sensor 10 can be shortened, therebylowering manufacturing cost.

Generally, in a magnetic sensor using magnetoresistive element such asGMR elements, when a strong external magnetic field acts on the magneticsensor, the direction of magnetization of the free layer of themagnetoresistive elements may fail to be restored to its initial state.Consequently, the magnetic sensor is preferably configured in such amanner that initialization coils are disposed directly beneath themagnetoresistive elements, and that when the initialization coils areelectrically energized as a result of establishment of a predeterminedcondition (e.g., operation of the specific switch of the operationsection 45), the initialization coils generate a magnetic field torestore the direction of magnetization of the free layer to its initialstate.

In this case, in the magnetic sensor, the above-mentioned initializationcoils may be provided independently of the above-mentioned heating coils21-24. For example, the initialization coils may be formed in a layer(the layer S1 or layer S2 in the present embodiment) other than thelayer (layer S3 in the present embodiment) in which the heating coils21-24 are formed. If the initialization coils and the heating coils arethus provided independently of each other, then the individual heatingcoils can be designed in a desired shape (a shape suitable for heating).For example, the heating coil may be in the form of a turnover heater(heat generating element) whose one end is located off the coil center.Further, instead of the heating coil, a sheet-like heater (heatgenerating member) may be used.

Alternatively, the heating coils 21-24, as mentioned above, may servealso as initialization coils. In this case, provision of dedicatedinitialization coils is unnecessary, thereby lowering the manufacturingcost of the magnetic sensor 10. Further, when the heating coils 21-24are electrically energized once, heating and initializing of theelements 11-18 can be carried out simultaneously in order to obtain thebasic data for compensation of temperature characteristic, therebysimplifying the manufacturing process and lowering manufacturing cost.

Further, as described above, the magnetic sensor using magnetoresistiveelements such as the GMR elements 11-18 may be used also as ageomagnetism sensor that calculates the direction by arithmeticallyprocessing the output values of the magnetoresistive elements, whichvalues change with variation in magnitude of an external magnetic field.In this case, at the stage of shipping, etc., a test must be performedto check whether the magnetoresistive elements correctly function in anexternal magnetic field.

In this test, a known external magnetic field must be applied to themagnetoresistive elements. In order to apply such knownexternal-magnetic-field to the magnetoresistive elements, generatingexternal-magnetic-field equipment is required. However, such equipmentis expensive. Consequently, as an alternative, the magnetic sensor maybe configured in such a manner that test coils are disposed adjacent to(e.g., directly beneath) the magnetoresistive elements, and that whenelectrically energized, the test coils apply to the magnetoresistiveelements an external magnetic field for the test.

In this case, in the magnetic sensor 10, the above-mentioned test coilsmay be provided independently of the above-mentioned heating coils21-24. For example, the test coils may be formed in a layer (the layerS1 or layer S2 in the present embodiment) other than the layer (layer S3in the present embodiment) in which the heating coils 21-24 are formed.If the test coils and the heating coils are thus provided independentlyof each other, the individual heating coil can be designed in a desiredshape (a shape suitable for heating). For example, the heating coil maybe in the form of a turnover heater (heat generating element) whose oneend is located off the coil center. Further, in place of the heatingcoil, a sheet-like heater (heat generating member) may be used.

Alternatively, the heating coils 21-24 may be mounted at a positionangularly moved through 90° as viewed in plan so that the heating coils21-24 can serve also as the above-mentioned test coils. In this case,coils dedicated to testing become unnecessary, thereby lowering the costof the magnetic sensor 10.

Further, in the above-mentioned magnetic sensor 10, each heating coil 21(22-24) includes a first wire 21-1 forming a spiral as viewed in plan,and a second wire 21-2 forming a spiral as viewed in plan; the elementgroups Gr1-Gr4 are located between the spiral center P1 of the firstwire and the spiral center P2 of the second wire as viewed in plan; andthe first and second wires are interconnected in such a way that thatcurrent flows in approximately the same direction in both a portion ofthe first wire which overlaps an arbitrary element group as viewed inplan, and a portion of the second wire which overlaps the arbitraryelement group as viewed in plan.

As a result, a strong magnetic field (e.g., a magnetic fieldsufficiently strong for initialization) can applied to themagnetoresistive elements 11-18 while the areas of the heating coils21-24 serving also as the initialization coils (or test coils) areminimized as viewed in plan, whereby the magnetic sensor 10 can bereduced in size.

In the first embodiment, for heating the GMR elements, a 100 mA currentis supplied to the heating coils 21-24 in sequence for 100 ms each;alternatively, for example, a 25 mA current may be supplied to all ofthe heating coils 21-24 simultaneously for 400 ms. In this simultaneousenergization, a better temperature balance between the heating coils21-24 can be achieved as compared with the case of the sequentialenergization.

SECOND EMBODIMENT

A magnetic sensor 50 according to a second embodiment of the presentinvention will now be described with reference to FIG. 14, which shows aplan view of the magnetic sensor 50, and FIG. 15, which is a partialcross-sectional view of the magnetic sensor 50 taken along line 1-1 ofFIG. 14. The magnetic sensor 50 is identical in configuration with themagnetic sensor 10 of the first embodiment, except that a heating coil70 for heating GMR elements 11-18 (element groups Gr1-Gr4) is mountedindependently of initialization coils 61-64. Therefore, the followingdescription will focus largely on this modified point.

Like the corresponding heating coils 21-24, the initialization coils61-64 of FIGS. 14 and 15 are embedded in the layer S3 directly beneaththe element groups Gr1-Gr4, respectively (in the negative Z direction).When electrically energized under a predetermined condition (e.g.,before the detection of magnetism), the initialization coils 61-64generate, in each of the free layers of the magnetoresistive elementslocated above the respective heating coils, a magnetic field (aninitializing magnetic field) of a predetermined direction (directionperpendicular to the direction of pinned magnetization of thecorresponding pinned layer).

The heating coil 70 assumes the form of, for example, a thin layer ofaluminum and has a spiral shape (not shown) as viewed in plan. The shapeof the heating coil 70 approximates a square whose sides are parallel tothe corresponding sides of a square defined by a bridge wiring section19 and whose centroid is aligned with the centroid of the square of thebridge wiring section 19. The heating coil 70 is formed inside thebridge wiring section 19 as viewed in plan. Further, as is understoodfrom FIG. 15, the heating coil 70 is embedded and formed in, among aninsulating layer INS1 and wiring layers S1-S3 superposed in sequence ona substrate 50 a, a layer S3 (the uppermost layer of the layers S1-S3functioning as the wiring layers) on the upper surface on which the GMRelements 11-18 are formed.

Further, the heating coil 70 is configured in such a manner that aquantity of heat to be propagated from the heating coil 70 to anarbitrary one of the plurality of GMR elements 11-18 is approximatelyequal to the quantity of heat to be propagated from the heating coil 70to another of the plurality of magnetoresistive elements 11-18.

In this magnetic sensor 50, as in the magnetic sensor 10, compensationof temperature-dependent characteristic is carried out. Namely, in astage in which the magnetic sensor has not yet been mounted in thecellular phone, the heating coils 70 are electrically energized toobtain the above-described ratios (gradients) Mx and My, which are thebasic data for compensation of temperature-dependent characteristic.FIG. 16 shows isothermal lines on the surface on which the elementgroups Gr1-Gr4 are formed, by curves Lj1 and Lj2. The temperature of theisothermal line represented by the curve Lj1 is higher than thetemperature of the isothermal line represented by the curve Lj2.

Namely, when electrically energized, the heating coil 70 heats mainlythe element groups Gr1-Gr4. As a result, the element groups Gr1-Gr4become approximately equal in temperature. In contrast, when the elementgroups Gr1-Gr4 are heated to a temperature sufficiently high to obtainthe basic data for compensation of temperature-dependent characteristic,the whole magnetic sensor 50 including the substrate 50 a is notuniformly heated, so that the upper surface of the layer S3 on whichsurface the element groups Gr1-Gr4 are formed becomes nonuniform intemperature due to the generation of heat by the heating coil 70.

In other words, in the magnetic sensor 50, when the basic data forcompensation of temperature-dependent characteristic are obtained, theGMR elements 11-18 are not heated (do not need to be heated) to such atemperature that the entire magnetic sensor 50 including the substrate50 a attains a uniform temperature. Therefore, the period of time neededfor the heating/cooling of the GMR elements 11-18 can be shortened, ascompared with the case in which the entire magnetic sensor 50 is heatedby a heating device.

Therefore, according to the magnetic sensor 50, the basic data forcompensation of temperature-dependent characteristic can be obtainedwithin a short period of time, within which geomagnetism is veryunlikely to change, whereby the data can be obtained with precision. Asa result, the temperature-dependent characteristic of the magneticsensor 50 can be compensated accurately.

Further, because the magnetic sensor 50 can be cooled within a shorttime as compared with the case in which the magnetic sensor 50 is cooledafter having been heated by use of a heating device, the period of timerequired for fabricating the magnetic sensor 50 can be shortened, andthe manufacturing cost can be lowered. Furthermore, because the heatingcoil 70 is embedded in the layer S3, which is the uppermost one of thethree wiring layers S1-S3 and is closest to the GMR elements 11-18, theGMR elements 11-18 can be heated efficiently.

Alternatively, instead of the above-mentioned initialization coils61-64, the above-mentioned test coil may be disposed in the same regionwhich had been occupied by the initialization coils. As anotheralternative, the test coil may be formed independently of theinitialization coils 61-64 and the heating coil 70 so as to be locateddirectly beneath the initialization coils 61-64. As still anotheralternative, the initialization coils may be formed in a lower layer,such as the layer S1, while the test coil may be formed in an upperlayer, such as the layer S3.

As is described hereinabove, with the magnetic sensor and the method forcompensation of temperature-dependent characteristic of a magneticsensor according to the present invention, the temperature-dependentcharacteristic of the magnetic sensor can be compensated accurately.Further, in consideration of the fact that the magnetic sensor 10, 50including the X- and Y-axis magnetic sensors is configured in the formof a full-bridge circuit, and the temperature-dependent characteristicof the magnetic sensor changes in proportion to the variations intemperature of the magnetoresistive element, the above-mentioned“ratios” Mx, My are stored in a WORM memory of the magnetic sensor.Therefore, after the magnetic sensor is mounted in an electronicapparatus, the electronic apparatus can read the “ratios” from thememory to thereby obtain data of the temperature-dependentcharacteristic of the magnetic sensor, and can compensate thetemperature-dependent characteristic of the magnetic sensor by use ofthe obtained data.

Further, because data of the temperature-dependent characteristic ofeach magnetic sensor 10, 50 can be saved in the magnetic sensor bystoring merely the above-mentioned “ratios” (gradients Mx, My) into thememory of the magnetic sensor 10 or 50, the quantity of data to bestored in the memory can be minimized as compared with the case in whicha plurality of data sets each including an element temperature and amagnetic sensor output are stored in a memory. Furthermore, because theabove-mentioned “ratios” (gradients Mx and My) do not change, the memorymay be of a WORM type, which is inexpensive. As a consequence of theforegoing, the cost of the magnetic sensor can be lowered.

The present invention is not limited to the foregoing embodiments, andvarious modifications may be possible within the scope of the invention.For example, for the magnetoresistive elements of the magnetic sensor 10or 50, TMR elements may be used instead of the GMR elements. Further, anelectronic apparatus in which the magnetic sensor 10 or 50 is to bemounted is not limited to a cellular phone. Namely, they can beaccommodated in another electronic apparatus, such as a mobile computer,a portable navigation system, or a PDA (personal information equipmentcalled a “Personal Digital Assistant”).

Further, in each of the foregoing embodiments, the first temperature T1of the GMR element 18, the first output value X1 of the X-axis magneticsensor, and the first output value Y1 of the Y-axis magnetic sensor areobtained before electrical energization of the heating coils 21-24 or70; and the second temperature T2 of the GMR element 18, the secondoutput value X2 of the X-axis magnetic sensor, and the second outputvalue Y2 of the Y-axis magnetic sensor are obtained after electricalenergization of the heating coils 21-24 or 70; whereupon the gradientsMx, My are calculated. However, the embodiment may be modified in such amanner that the first temperature T1 of the GMR element 18, the firstoutput value X1 of the X-axis magnetic sensor, and the output value Y1of the Y-axis magnetic sensor are obtained after electrical energizationof the heating coils 21-24 or 70; the second temperature T2 of the GMRelement 18, the second output value X2 of the X-axis magnetic sensor,and the second output value Y2 of the Y-axis magnetic sensor areobtained after lapse of a predetermined time from termination of theelectrical energization of the heating coils 21-24 or 70; and then thegradients Mx and My are calculated.

Furthermore, as shown in FIG. 17, the heating coil 70 of the secondembodiment may be substituted by a heating coil 80 having a pattern witha cutout corresponding to a central portion of the heating coil 70.According to this alternative heating coil 80, the magnetoresistiveelements 11-18 can be heated to approximately the same temperature whenthe heating coil 80 is electrically energized; and the central portionof the magnetic sensor 50 (substrate 50 a) is not overheated. Therefore,the GMR elements 11-18 can be heated with increased efficiency.

Still further, the heating coil, the initialization coil, and the testcoil may be formed independently of one another so as to be superposedone over another at a position directly beneath each GMR element group.In this case, as shown better in FIG. 18, the layer INS1 and the fourwiring layers S1-S4 are superposed one over another in sequence on thesubstrate; and a heating coil 101, an initialization coil 102, and atest coil 103 may be formed in the layer S4, the layer S3, and the layerS1, respectively. Further, the bridge wiring may extend across aplurality of layers.

In addition, the present invention can be employed not only in adouble-axis-direction-detecting-type magnetic sensor equipped with X-and Y-axis magnetic sensors, but also in atriple-axis-direction-detecting-type magnetic sensor equipped with X-,Y-, and Z-axis magnetic sensors or asingle-axis-direction-detecting-type magnetic sensor.

1. A magnet sensor comprising a single substrate, a plurality ofmagnetoresistive elements, a bridge circuit for bridge-interconnectingsaid plurality of magnetoresistive elements, and a control circuitsection for obtaining via said bridge circuit a physical quantitydetermined on the basis of resistance values of said plurality ofmagnetoresistive elements and processing the physical quantity so as togenerate an output signal to be output to the outside, wherein saidmagnetic sensor further includes a plurality of layers superposed onsaid substrate; said magnetoresistive elements are formed on an uppersurface of one of said plurality of layers; said bridge circuit and saidcontrol circuit section are formed in said substrate and said pluralityof layers; and said magnetoresistive elements, said bridge circuit, andsaid control circuit section are interconnected in said plurality oflayers by a connection section formed of a conductive substance andextending along a direction intersecting layer surfaces of said layers.2. A magnetic sensor according to claim 1, wherein said plurality ofmagnetoresistive elements are interconnected by said bridge circuit toconstitute two full-bridge circuits.
 3. A magnetic sensor according toclaim 1, wherein said plurality of magnetoresistive elements includesfirst to fourth X-axis magnetoresistive elements that are interconnectedby said bridge circuit to constitute a full-bridge circuit which is anX-axis magnetic sensor whose magnetic field detecting direction is anX-axis direction and first to fourth Y-axis magnetoresistive elementsthat are interconnected by said bridge circuit to constitute anotherfull-bridge circuit which is a Y-axis magnetic sensor whose magneticfield detecting direction is a Y-axis direction.
 4. A magnetic sensoraccording to claim 3, wherein said X-axis and said Y-axis are mutuallyperpendicular.
 5. A magnetic sensor according to claim 1, wherein saidcontrol circuit section is formed beneath said magnetoresistiveelements.
 6. A magnetic sensor according to claim 1, wherein saidcontrol circuit section includes an analog-to-digital converter.
 7. Amagnetic sensor according to claim 6, wherein said control circuitsection performs analog-to-digital conversion by said analog-to-digitalconverter for obtaining said physical quantity so as to generate saidoutput signal.
 8. A magnetic sensor according to claim 1, wherein saidcontrol circuit section includes a memory.
 9. A magnetic sensoraccording to claim 8, wherein said memory is a WORM memory capable ofwriting data once and reading the data many times.
 10. A magnetic sensoraccording to claim 1, wherein upper surface of said one of the pluralityof layers on which said magnetoresistive elements are formed aresmoothed.
 11. A magnet sensor comprising a single substrate, a pluralityof magnetoresistive elements, a bridge circuit bridge-interconnectingsaid plurality of magnetoresistive elements, and a control circuitsection for obtaining via said bridge circuit a physical quantitydetermined on the basis of resistance values of said plurality ofmagnetoresistive elements and processing the physical quantity so as togenerate an output signal to be output to the outside, wherein saidmagnetic sensor further includes a plurality of layers superposed onsaid substrate; said magnetoresistive elements are formed on an uppersurface of one of said plurality of layers; said bridge circuit and saidcontrol circuit section are formed in said substrate and said pluralityof layers; and said control circuit section is located inward of saidbridge circuit and is connected to said magnetoresistive element and/orsaid bridge circuit by a connection section formed of a conductivesubstance and extending along a direction intersecting layer surfaces ofsaid layers.